package method.Thread;

public class ThreadDemo extends Thread {
    int count = 0;
    String name;
    public ThreadDemo(String name){
        this.name=name;
    }
    public void run(){
        while(count<5){
            System.out.println(name+":"+count);
            count++;
            try{
                sleep(1000);
            }catch (InterruptedException e){
                e.printStackTrace();
            }
        }
    }
}
